#ifndef SHADOW2D_H
#define SHADOW2D_H
#include "treegen.h"

class Shadow2D
{
public:
    Shadow2D();
    ~Shadow2D();
    void populateGrid(Bud *bud);
    void queryQ(Bud *bud);
    inline void convertToIndex(float3 loc, int &w, int &h);
    inline void indexToXY(int w, int h, float3 &loc);
    void draw();
private:
    void recurPopulate(Bud *bud);
    void recurQueryQ(Bud *bud);

    float *m_grid;
    float m_maxw,m_maxh;
};

#endif // SHADOW2D_H
